<!-- userEditForm.php 用于显示要更新的用户信息的表单。 -->
<!doctype html>
<html>
 <head>
  <meta charset="UTF-8">  
  <title>修改用户信息</title>
 </head>
 <body>
 <?php
   
   //$row = $data['one'];
   //var_dump($row); 
   /*$id = $row['uid'];  
   $uname = $row['uname'];
   $gender = $row['gender'];
   $birthdate = $row['birthdate'];
   $hobby = $row['hobby'];
   $degree = $row['degree'];
   $intro = $row['intro'];
   $pic = 'upload/'.$row['pic'];*/  

   $row = $data['one'][0];
 
   //var_dump($row);   
  $id = $row['uid'];
   $uname = $row['uname'];
   $gender = $row['gender'];
   $stnumber = $row['stnumber'];
   $phonenumber = $row['phonenumber'];
   
   $pic = "upload/".$row['pic'];    
  //将查询结果显示在表单中
 ?>

<form method="post"  action="admin.php?c=user&m=update"  enctype="multipart/form-data">
<table align="center" border="1" width=500>
<caption>修改用户</caption>
<tr>
  <td width="20%">id</td>
  <td width="80%"><?php  echo $id;  ?>
  <input type="hidden" name="id" value=<?php  echo $id;  ?>>  
  </td>
</tr>
<tr>
  <td>姓名：</td>
  <td><input type="text" name="uname" size=30  value=<?php  echo $uname;  ?>></td>
</tr>
<tr>
<td>性别:</td>
<td>
<input type="radio" name="gender" value="0" <?php  if(!$gender) echo 'checked';  ?>>男
<input type="radio" name="gender" value="1" <?php  if($gender) echo 'checked';  ?>>女</td>
</tr>
<tr>
  <td>学号：</td>
  <td><input type="text" name="stnumber"  size=30 value=<?php  echo $stnumber;  ?>></td>
</tr>
<tr>
  <td>手机号：</td>
  <td><input type="text" name="phonenumber"  size=30 value=<?php  echo $phonenumber;  ?>></td>
</tr>

<tr>
  <td width=150>头像</td>   
  <td>
  <img src='<?php  echo $pic;  ?>' width=100 height=150>
  <input type="file" name="pic">
  </td>
</tr>
<tr>
<td width=150></td>
<td>
<input type="submit" value="更新">
<input type="reset" value="重置">
</td>
</tr>
</table>
</form>
 </body>
</html>